﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
           
        float op1, op2;
        float result=0;
        char opt;
        op1=Single .Parse (textBox1 .Text );
        op2=Single .Parse (textBox2 .Text );
        opt=char.Parse (comboBox1  .Text );
        switch(opt)
        {
            case '+':
        result=op1+op2;
        break;
            case '-':
        result=op1-op2;
        break;
            case '*':
        result=op1*op2;
        break;
            case '/':
        result=op1/op2;
        break;
            default:
        MessageBox.Show("请选择算术运算符号");
        break;
}
        textBox3 .Text=result.ToString();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            textBox1.Text = "";
            textBox2.Text = "";
            textBox3.Text = "";
            comboBox1.Text = "";
        }
    }
}
